package com.twu.biblioteca.presenter;

import com.twu.biblioteca.model.IFactory;
import com.twu.biblioteca.model.item.ItemFormatter;
import com.twu.biblioteca.model.LibraryCatalogue;
import com.twu.biblioteca.model.session.Session;
import com.twu.biblioteca.view.ItemView;

/**
 * Created with IntelliJ IDEA.
 * User: cschlumb
 * Date: 08/08/2013
 * Time: 11:53
 * To change this template use File | Settings | File Templates.
 */
public class BookPresenter implements Presenter {

    private final LibraryCatalogue libraryCatalogue;
    private final ItemView view;
    private final ItemFormatter bookFormatter;

    public BookPresenter(LibraryCatalogue libraryCatalogue, ItemFormatter bookFormatter, ItemView view) {
        this.libraryCatalogue = libraryCatalogue;
        this.view = view;
        this.bookFormatter = bookFormatter;
    }

    @Override
    public void go(Session session) {
        libraryCatalogue.formatBookList(bookFormatter);
        view.showList(bookFormatter);
    }
}
